package com.els.pages.controller;

import com.els.pages.service.FeignClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @title: SearchGetController
 * @projectName fake-baidu
 * @Date: 2021/7/1 20:52
 * @Author: lei.yu-esint
 * @Description:
 */
@RestController
@RequestMapping("/search")
public class SearchGetController {

    @Autowired
    private FeignClientService feignClientService;

    @PostMapping("/getIndexPushNews/{pages}/{size}")
    public String getIndexPushNews(@PathVariable String pages, @PathVariable String size){
        String newsData=feignClientService.getIndexPushNews(pages,size);
        return newsData;
    }

    /**
     * 首页搜索关键字查询
     * @param keyword
     * @return
     */
    @GetMapping("/getIndexKeywords/{keyword}/{page}/{size}")
    public String getIndexKeywords(@PathVariable String keyword,@PathVariable String page,@PathVariable String size){
        String newsData=feignClientService.getIndexKeywords(keyword,page,size);
        return newsData;
    }
}
